package com.hckjsec.oa.service.impl;

import java.util.List;
import com.hckjsec.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hckjsec.oa.mapper.OaLeaveMapper;
import com.hckjsec.oa.domain.OaLeave;
import com.hckjsec.oa.service.IOaLeaveService;

/**
 * 公司OA请假Service业务层处理
 * 
 * @author cyt
 * @date 2022-01-05
 */
@Service
public class OaLeaveServiceImpl implements IOaLeaveService 
{
    @Autowired
    private OaLeaveMapper oaLeaveMapper;

    /**
     * 查询公司OA请假
     * 
     * @param id 公司OA请假ID
     * @return 公司OA请假
     */
    @Override
    public OaLeave selectOaLeaveById(Long id)
    {
        return oaLeaveMapper.selectOaLeaveById(id);
    }

    /**
     * 查询公司OA请假列表
     * 
     * @param oaLeave 公司OA请假
     * @return 公司OA请假
     */
    @Override
    public List<OaLeave> selectOaLeaveList(OaLeave oaLeave)
    {
        return oaLeaveMapper.selectOaLeaveList(oaLeave);
    }

    /**
     * 新增公司OA请假
     * 
     * @param oaLeave 公司OA请假
     * @return 结果
     */
    @Override
    public int insertOaLeave(OaLeave oaLeave)
    {
        oaLeave.setCreateTime(DateUtils.getNowDate());
        return oaLeaveMapper.insertOaLeave(oaLeave);
    }

    /**
     * 修改公司OA请假
     * 
     * @param oaLeave 公司OA请假
     * @return 结果
     */
    @Override
    public int updateOaLeave(OaLeave oaLeave)
    {
        oaLeave.setUpdateTime(DateUtils.getNowDate());
        return oaLeaveMapper.updateOaLeave(oaLeave);
    }

    /**
     * 批量删除公司OA请假
     * 
     * @param ids 需要删除的公司OA请假ID
     * @return 结果
     */
    @Override
    public int deleteOaLeaveByIds(Long[] ids)
    {
        return oaLeaveMapper.deleteOaLeaveByIds(ids);
    }

    /**
     * 删除公司OA请假信息
     * 
     * @param id 公司OA请假ID
     * @return 结果
     */
    @Override
    public int deleteOaLeaveById(Long id)
    {
        return oaLeaveMapper.deleteOaLeaveById(id);
    }
}
